Skip to content

Enable the creation of mTLS encrypted gRPC channels leveraging NI TLS via nitlsconfig (Python) - #1019

Open
alexdubois-ni wants to merge 9 commits into
masterfrom
users/adubois/integrateNITLSConfigForGRPC
Open

Enable the creation of mTLS encrypted gRPC channels leveraging NI TLS via nitlsconfig (Python)#1019
alexdubois-ni wants to merge 9 commits into
masterfrom
users/adubois/integrateNITLSConfigForGRPC

Conversation

@alexdubois-ni

@alexdubois-ni alexdubois-ni commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator
  • This contribution adheres to CONTRIBUTING.md.

  • I've updated CHANGELOG.md if applicable.

  • I've added tests applicable for this pull request

Note: I've only added unit tests as of this time. We intend to add system tests in a follow-up PR.

We also intend to add documentation in a follow-up PR.

What does this Pull Request accomplish?

Leverage and integrate nitlsconfig (from the nitlsconfig-python repository). This will give us the capability to:

  • Use nitlsconfig for integration with NI TLS workflows from Hardware Manager to produce secure gRPC channels.
  • Perform integration to add other parts of nitlsconfig's Python support such as client side connection auditing and improved error elaborations to aid customers.

Why should this Pull Request be merged?

Without this integration, customers would need to know about and add nitlsconfig[grpc] themselves as a python package to install. This will add a unified platform method for mTLS encryption with gRPC.

Furthermore, we can also leverage our package and integrate it to add CRA required audit logging capabilities and also help us provide customers with additional setup debugging information telling them they need to go to Hardware Manager.

Lastly, this is all provided from a shared public github repo that we can modify to reiterate and share our code and improvements with nimi-python.

NOTE: nitlsconfig 1.0.0a4 is our most recent alpha version. We will publish a formal 1.0.0 after we've completed all of our testing. This will automatically be pulled in for customers with our existing >= 1.0.0a4. But, we will want to go back and update this to 1.0.0 most likely, especially if owners here would desire this :)

What testing has been done?

Unit tests have been added and succeeded locally. System tests are soon to follow.

We have integrated this very identically in nimi-python for all of our gRPC Python API supporting drivers and it has been unit tested and manually tested there as well (ATS tests pending in that repo, soon to follow for here too).

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Test Results

    46 files  +    15      46 suites  +15   1h 22m 59s ⏱️ + 41m 5s
 3 181 tests +     6   2 564 ✅ +     6     617 💤 ±    0  0 ❌ ±0 
61 734 runs  +29 233  49 336 ✅ +23 034  12 398 💤 +6 199  0 ❌ ±0 

Results for commit bdf3b89. ± Comparison against base commit f673570.

♻️ This comment has been updated with latest results.

Comment thread generated/nidaqmx/_grpc_interpreter.py
Comment thread CHANGELOG.md Outdated
Comment thread generated/nidaqmx/_grpc_interpreter.py Outdated
Comment thread tests/unit/test_nitlsconfig_grpc_integration.py Outdated
Comment thread generated/nidaqmx/_grpc_interpreter.py
Comment thread generated/nidaqmx/_grpc_interpreter.py
Comment thread src/codegen/templates/_grpc_interpreter.py.mako

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Partial version-query failures can incorrectly audit an established server connection as unsuccessful.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Integrates nitlsconfig with NI-DAQmx gRPC sessions for TLS diagnostics and connection auditing.

Changes:

  • Adds nitlsconfig[grpc] dependency and lock data.
  • Audits connection outcomes and elaborates TLS failures.
  • Adds integration-focused unit tests and release notes.
File summaries
File Description
.config/cspell/project-software-terms.txt Adds dependency terminology.
CHANGELOG.md Documents NI TLS support.
generated/nidaqmx/_grpc_interpreter.py Adds auditing and TLS error elaboration.
poetry.lock Locks new dependencies.
poetry.toml Exempts nitlsconfig from release-age checks.
pyproject.toml Adds nitlsconfig to the gRPC extra.
src/codegen/templates/_grpc_interpreter.py.mako Generates the integration logic.
tests/unit/test_nitlsconfig_grpc_integration.py Tests auditing and TLS errors.
Review details
  • Files reviewed: 6/8 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/codegen/templates/_grpc_interpreter.py.mako

@zhindes zhindes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing more than Brad's comments!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require any new software to be installed for existing non-TLS use cases? I see that the nitlsconfig Python package shells out to a new nitlsconfig command: https://github.com/ni/nitlsconfig-python/blob/main/src/nitlsconfig/cli.py

I saw the comment about "create_grpc_device_channel needs the nitlsconfig CLI installed on the system." I just want to check that the auditing part works without the nitlsconfig CLI. Otherwise, this will break existing applications with older drivers that install the latest nidaqmx Python package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants